package modeller.queueingnetworksmodel.visits;

import modeller.databasedesignmodel.relation.Relation;
import modeller.databasedesignmodel.transaction.Transaction;
import static queped.NeptuneHelperFunctions.*;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Created by:  Jason Ye
 * Date:        24/06/2012
 * Time:        22:46
 */
public class VisitMatrix {

    HashMap<Relation,HashMap<Transaction,Integer>> visitsByRelationAndTransaction = new HashMap<Relation, HashMap<Transaction, Integer>>();

    ArrayList<Double> flatVisitCounts = new ArrayList<Double>();

    public VisitMatrix() {

    }

    public void addVisit(Relation relation, Transaction transaction, double visit){

        HashMap<Transaction,Integer> visitsByTransaction = componentExtract(visitsByRelationAndTransaction, relation, new HashMap<Transaction, Integer>());

        //visitsByTransaction.put(transaction,visit);

    }

    public HashMap<Relation,HashMap<Transaction,Integer>> normalise(){

        // check for anything less than 1
        boolean hasBranches = false;
        // check for any prime numbers
        boolean hasPrimeOrIrreducible = false;
        /*for(Double i : flatVisitCounts){
            if(i<1){
                hasBranches=true;
                break;
            } else if(isPrime(Doui)){
                hasPrimeOrIrreducible = true;
            }
        }*/

        if(hasBranches){

        }

        return visitsByRelationAndTransaction;
    }
}
